﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace LybrixNursingCRMDesktop.FrameWork
{
    public static class Messages
    {
        #region Messages with MSG-ID

        public static MessageBoxResult ShowError(string msgID, MessageBoxButton button, params string[] parameters)
        {
            return MessageBox.Show(string.Format(Application.Current.Resources[msgID].ToString(), parameters), Application.Current.Resources["GNR001"].ToString(),
                                   button, MessageBoxImage.Error, MessageBoxResult.OK, MessageBoxOptions.RightAlign);
        }

        public static MessageBoxResult ShowWarning(string msgID, MessageBoxButton button, params string[] parameters)
        {
            return MessageBox.Show(string.Format(Application.Current.Resources[msgID].ToString(), parameters), Application.Current.Resources["GNR002"].ToString(),
                                   button, MessageBoxImage.Warning, MessageBoxResult.OK, MessageBoxOptions.RightAlign);
        }

        public static MessageBoxResult ShowInformation(string msgID, MessageBoxButton button, params string[] parameters)
        {
            return MessageBox.Show(string.Format(Application.Current.Resources[msgID].ToString(), parameters), Application.Current.Resources["GNR003"].ToString(),
                                   button, MessageBoxImage.Information, MessageBoxResult.OK,
                                   MessageBoxOptions.RightAlign);
        }

        #endregion

        #region Message with String

        public static MessageBoxResult ShowError(string message, MessageBoxButton button)
        {
            if ((Application.Current.Resources[message]) != null)
                return MessageBox.Show(Application.Current.Resources[message].ToString(), Application.Current.Resources["GNR001"].ToString(), button, MessageBoxImage.Error, MessageBoxResult.OK,
                                       MessageBoxOptions.RightAlign);
            else
                return MessageBox.Show(message, Application.Current.Resources["GNR001"].ToString(), button,
                                       MessageBoxImage.Error, MessageBoxResult.OK, MessageBoxOptions.RightAlign);
        }

        public static MessageBoxResult ShowWarning(string message, MessageBoxButton button)
        {
            if ((Application.Current.Resources[message]) != null)
                return MessageBox.Show(Application.Current.Resources[message].ToString(), Application.Current.Resources["GNR002"].ToString(), button, MessageBoxImage.Warning, MessageBoxResult.OK,
                                       MessageBoxOptions.RightAlign);
            else
                return MessageBox.Show(message, Application.Current.Resources["GNR002"].ToString(), button,
                                       MessageBoxImage.Warning, MessageBoxResult.OK, MessageBoxOptions.RightAlign);
        }

        public static MessageBoxResult ShowInformation(string message, MessageBoxButton button)
        {
            if ((Application.Current.Resources[message]) != null)
                return MessageBox.Show(Application.Current.Resources[message].ToString(), Application.Current.Resources["GNR003"].ToString(), button, MessageBoxImage.Information, MessageBoxResult.OK,
                                       MessageBoxOptions.RightAlign);
            else
                return MessageBox.Show(message, Application.Current.Resources["GNR003"].ToString(), button,
                                       MessageBoxImage.Information, MessageBoxResult.OK, MessageBoxOptions.RightAlign);
        }

        #endregion
    }
}
